#pragma once
#include "GameObject.h"
#include "..\\SGD Wrappers\\SGD_Listener.h"

#include "../SGD Wrappers/SGD_Handle.h"

class Emitter;

class StaticObject : public GameObject, public SGD::Listener
{
public:
	StaticObject();
	virtual ~StaticObject();

	enum StaticObjectType { STAT_BASE = 10, STAT_AUGMENT, STAT_PICKUP, STAT_ROCK, STAT_TABLE, STAT_LADDER, STAT_STAIRS};

	/**********************************************************/
	// Interface:
	//	- virtual functions for children classes to override
	virtual void	Update(float elapsedTime)		override;
	virtual void	Render(void)					override;

	virtual SGD::Rectangle GetRect(void)	const			override;
	virtual SGD::Rectangle GetActiveRect(void)	const override;

	virtual int		GetType(void)	const			override	{ return STAT_BASE; }
	virtual void	HandleCollision(GameObject* pOther)	override;
	virtual void	HandleEvent(const SGD::Event* pEvent) override;
	// Children classes CANNOT override a 'final' method.
	virtual void	AddRef(void)				final;
	virtual void	Release(void)				final;

	/**********************************************************/
	// Accessors:
	SGD::HTexture		GetImage(void) const			{ return m_hImage; }
	SGD::Vector			GetVelocity(void) const			{ return m_vtVelocity; }
	SGD::Size			GetSize(void) const				{ return m_szSize; }
	float				GetRotation(void) const			{ return m_fRotation; }
	Emitter* GetEmitter() { return myEmitter; }

	// Mutators:
	void				SetImage(SGD::HTexture	img)			{ m_hImage = img; }
	void				SetVelocity(SGD::Vector	vel) 			{ m_vtVelocity = vel; }
	void				SetSize(SGD::Size size)					{ m_szSize = size; }
	void				SetRotation(float ang)					{ m_fRotation = ang; }
	void SetEmitter(Emitter* emit) { myEmitter = emit; }



protected:
	SGD::HTexture		m_hImage = SGD::INVALID_HANDLE;	// image handle
	SGD::Vector			m_vtVelocity = SGD::Vector{ 0, 0 };	// 2D velocity
	SGD::Size			m_szSize = SGD::Size{ 0, 0 };		// 2D size
	float				m_fRotation = 0.0f;		// angle in radians
	Emitter* myEmitter = nullptr;



private:
	/**********************************************************/
	// reference count
	unsigned int		m_unRefCount = 1;	// calling 'new' gives the prime reference

};

